package com.chen106106.sstest.dao;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

/**
 * 
 * @author chenz106106@gmail.com
 * 2012-7-15 下午12:05:00
 *
 * @param <T>
 */
public  class DaoSupportImpl<T> implements IDaoSupport<T>{

	
	private NamedParameterJdbcTemplate jdbcTemplate;
	
	private String tableName = "";
	
	private Logger log = Logger.getLogger(DaoSupportImpl.class);
	public void setJdbcTemplate(NamedParameterJdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	
	/**
	 * 构造函数注入要操作对象的对应的表的名字
	 * @param tableName
	 */
	public DaoSupportImpl(String tableName){
		this.tableName = tableName;
	}
	@Override
	public long add(T t) {
		String sql = "INSERT INTO "+tableName+"";
		return 0l;
	}

	@Override
	public boolean delete(int id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean update(T t) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public T queryById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> queryList(String field, Object value) {
		// TODO Auto-generated method stub
		return null;
	}
	
}
